/**
 * 
 */
package cu.ds.logicalsync.fytasrealm.communication;

import cu.ds.logicalsync.fytasrealm.communication.event.WorldStatusListener;
import cu.ds.logicalsync.fytasrealm.communication.model.PeerInfo;
import cu.ds.logicalsync.fytasrealm.model.World;

/**
 * WorldStatusServiceProvider handle the following operations
 * 
 * @author r.vashira
 */
public interface WorldStatusServiceProvider extends ServiceProvider {

	/**
	 * Request to enter Peer's world
	 * 
	 * @param requestor warrior.getPeerInfo() - who make the request 
	 * @param host warrior.getPeerInfo() - who is world's owner
	 * @param worldToEntered
	 * @return true if able to enter, false otherwise
	 */
	public boolean enterWorld(PeerInfo requestor, PeerInfo host, World worldToEntered);
	
	/**
	 * Request to leave Peer's world
	 * 
	 * @param requestor
	 * @param host
	 * @param worldToEntered
	 */
	public void leaveWorld(PeerInfo requestor, PeerInfo host, World worldToEntered);
	
	
	
	/**
     * Register a WorldStatus listener. The WorldStatus listener will be called 
     * whenever there is a event occur by the PeerStatus Service.
     *
     *  @param listener the WorldStatusListener
     */
	public void addListener(WorldStatusListener listener);
	
	/**
	 * Remove a WorldStatus listener which was previously registered with
 	 * {@link #addListener(WorldStatusListener) addListener()}.
	 * 
	 * @param listener The listener to be removed.
     *  @return true if the listener was successfully removed, false otherwise
	 */
	public boolean removeListener(WorldStatusListener listener);
	
}
